﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User/User.Master" AutoEventWireup="true" CodeBehind="SelectHTCP.aspx.cs" Inherits="CoolERP_Web.User.SelectHTCP" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../Scripts/lhgdialog/lhgcore.min.js" type="text/javascript"></script>
<script type="text/javascript">
    var DG = frameElement.lhgDG;
    function doSubmit() {
        var flag = false;
        $("#GridView1 input[type=checkbox][id=chkSel]").each(function () {
            if ($(this).attr("checked") == true) {
                flag = true;
                return;
            } 
        });
        if (flag)
            DG.curWin.selMore();
        else
            alert("请至少选择一种产品");
    }
    function setTotal() {
        var totalMoney = 0;
        $("#GridView1 input[type=checkbox][id=chkSel]").each(function () {
            if ($(this).attr("checked") == true) {
                var money = $(this).closest("tr").find("td").eq(10).text();
                totalMoney += parseFloat(money);
            }
        });
        $("#spanMoney").text(totalMoney.toFixed(2));
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:HiddenField ID="hidSelIds" runat=server />
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td class=tbHead_L></td>
        <td class=tbHead_M><div><b>选择产品</b></div></td>
        <td class=tbHead_R></td>
    </tr>
    <tr>
        <td class=tbBody_L></td>
        <td class=tbBody_M>
            <ul class=tags style="width:100%;">
                <li class=liTitle><div>查找合同</div></li>
            </ul>
            <table class="grvCSS" cellspacing="0" rules="all" border="1" style="width:100%;border-collapse:collapse;">
		        <tr>
			        <td>合同编号：<asp:TextBox ID="txtHTBH" runat="server"/></td>
                    <td>客户简称：<asp:TextBox ID="txtKHJC" runat="server"/></td>
                    <td>产品编号：<asp:TextBox ID="txtCPBH" runat="server"/></td>
                    <td>出货时间：<asp:TextBox ID="txtS_Time" runat="server" CssClass="textbox Wdate" Width=90px onclick="WdatePicker({dateFmt: 'yyyy-MM-dd'});"/>
                        —— <asp:TextBox ID="txtE_Time" runat="server" CssClass="textbox Wdate" Width=90px onclick="WdatePicker({dateFmt: 'yyyy-MM-dd'});"/></td>
                    <td><asp:ImageButton ID="btnQuery" runat="server" ImageUrl="~/Images/Common/btn_query0.png" OnClick="btnQuery_Click" />&nbsp;&nbsp;
                        <asp:ImageButton ID="btnReset" runat="server" ImageUrl="~/Images/Common/btn_reset0.png" OnClick="btnReset_Click" /></td>
		        </tr>
	        </table>
            <ul class=tags style="width:100%;">
                <li class=liTitle><div>合同列表</div></li>
                <li class=liRight><font color=red>可同时选择多个，然后点击“确定”按钮</font>&nbsp;&nbsp;
                 总计金额：¥<span id="spanMoney">0</span></li>
            </ul>
            <asp:GridView ID="GridView1" runat="server" Width=100% PageSize=20 ClientIDMode=Static CssClass="grvCSS" AutoGenerateColumns="False" AllowPaging="True">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate><label><input type="checkbox" onclick="checkAll('GridView1',this);setTotal();" />全选</label></HeaderTemplate>
                        <ItemTemplate><input type=checkbox id="chkSel" name="chkSel" value='<%# Eval("ID") %>' onclick="setTotal();" /></ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="合同编号" DataField="HTBH"/>
                    <asp:BoundField HeaderText="客户简称" DataField="KHJC"/>
                    <asp:BoundField HeaderText="产品编号" DataField="CPBH"/>
                    <asp:BoundField HeaderText="产品名称" DataField="CPMC"/>
                    <asp:BoundField HeaderText="产品类型" DataField="CPLX"/>
                    <asp:BoundField HeaderText="产品规格" DataField="CPGG"/>
                    <asp:BoundField HeaderText="产品颜色" DataField="CPYS"/>
                    <asp:TemplateField HeaderText="产品单价">
                        <ItemTemplate><%# Convert.ToDecimal(Eval("DJ")).ToString("F")%></ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="数量" DataField="SL"/>
                    <asp:TemplateField HeaderText="金额">
                        <ItemTemplate><%# (Convert.ToDecimal(Eval("DJ")) * Convert.ToDecimal(Eval("SL"))).ToString("F")%></ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="出货时间" DataField="CHSJ"/>
                </Columns>
                <PagerSettings Visible=false />
            </asp:GridView>
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CssClass="pager" UrlPaging="false" ShowCustomInfoSection="Left"
                FirstPageText="首页" LastPageText="尾页" PrevPageText="前页" NextPageText="后页" OnPageChanged="AspNetPager1_PageChanged" 
                TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" PageIndexBoxType="TextBox" ShowPageIndexBox="Always" 
                SubmitButtonText="Go" CustomInfoHTML="共%RecordCount%条数据，每页%PageSize%条，共%PageCount%页，当前为第%CurrentPageIndex%页">
            </webdiyer:AspNetPager>
            <asp:Panel ID="panMsg" runat="server" ClientIDMode=Static CssClass="msg24_attention" Visible=false>无相关数据</asp:Panel>
            <p align=center><img src="../Images/Common/btn_ok0.png" onclick="javascript:doSubmit();" style="cursor:pointer" />
            &nbsp;&nbsp;<input type=image src="../Images/Common/btn_close.png" onclick="DG.cancel();" /></p>
        </td>
        <td class=tbBody_R></td>
    </tr>
    <tr>
        <td class=tbFoot_L></td>
        <td class=tbFoot_M></td>
        <td class=tbFoot_R></td>
    </tr>
</table>
</asp:Content>
